package com.study.portal.controller.action;

import java.util.List;

import com.opensymphony.xwork2.ActionContext;
import com.study.portal.pojo.Bbs;
import com.study.portal.service.IBbsService;

public class BbsAction extends ActionSupport {
    private static final long serialVersionUID = -8213820442660445424L;
    private IBbsService bbsService;
    
    public void setBbsService(IBbsService bbsService) {
        this.bbsService = bbsService;
    }
    private Bbs queryForm = new Bbs();
    public Bbs getQueryForm() {
        return queryForm;
    }
    public void setQueryForm(Bbs queryForm) {
        this.queryForm = queryForm;
    }
    public String main(){
        return "bbs_main";
    }
    
    public String index(){
        return "bbs_index";
    }

    /**
     * 查询BBS列表
     * @return
     */
    public String queryList(){
        queryForm.setStatus(Bbs.STATUS_Y);//获取正常状态的BBS
        List<Bbs> list = this.bbsService.queryList(queryForm);
        ActionContext.getContext().put("list", list);
        return "bbs_list";
    }
}
